import request from '@/utils/request'

// 费用科目
const costAip = {
    list: '/v2/boss/project/cost/list',
    add: '/v2/boss/project/cost/add',
    update: '/v2/boss/project/cost/update',
    toggleStatus: '/v2/boss/project/cost/updateStatus',
    expenseImport: '/v2/boss/project/cost/import',
    expenseExport: '/v2/boss/project/cost/export'
}
// 费用科目列表
export function getList (parameter) {
    return request({
        url: costAip.list,
        method: 'post',
        data: parameter
    })
}
export function add (parameter) {
    return request({
        url: costAip.add,
        method: 'post',
        data: parameter
    })
}
export function updata (parameter) {
    return request({
        url: costAip.update,
        method: 'post',
        data: parameter
    })
}
export function toggleStatus (parameter) {
    return request({
        url: costAip.toggleStatus,
        method: 'post',
        data: parameter
    })
}
// 导入费用科目
export function expenseImport (parameter) {
    return request({
        url: costAip.expenseImport,
        method: 'post',
        data: parameter,
        headers: { 'Content-Type': 'multipart/form-data' }
    })
}
// 导出费用科目
export function expenseExport (parameter) {
    return request({
        url: costAip.expenseExport,
        method: 'get',
        params: parameter,
        responseType: 'blob'
    })
}
